<?php
/**
 * Front page categories menu markup helper.
 *
 * @category Zend
 * @package Helper
 * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc.
 * @version $Id$
 * @link http://framework.zend.com
 * @since Available since release 1.0
 * @license GPL v3
 */

class Zend_View_Helper_FrontPageCategoriesHelper extends Zend_View_Helper_Abstract
{
    /**
     * Zend_View_Interface
     */
    protected $_view;
    
    /**
     * Automatically sets view property when loaded
     * 
     * @param Zend_View_Interface $view 
     */
    public function setView(Zend_View_Interface $view)
    {
        $this->_view = $view;
    }
    
    /**
     * Returns front page categories menu HTML
     * 
     * @return string
     */
    public function frontPageCategoriesHelper()
    {
        $categories = Disputeo_Cache::classCache('Application_Model_Category')->getList();
        $category = strtolower($this->_view->category);
        
        return $this->_view->partial('partials/categories.phtml', array(
            'categories' => $categories,
            'active' => $category
        ));
    }
}
